import requests
import json


def geocode(address,key="3d66b8511123af91a9b1bb9df9a3c5c6",city=None,batch=None,sig=None,callback=None):
    url = "https://restapi.amap.com/v3/geocode/geo?parameters"
    params = {
        "address":address,
        "key":key,
        "city":city,
        "batch":batch,
        "sig":sig,
        "callback":callback,
    }
    response = requests.get(url,params=params)
    results = response.json()
    return results

def POI(location,types,key="3d66b8511123af91a9b1bb9df9a3c5c6"):
    POI_url = "https://restapi.amap.com/v3/place/around"
    params = {
        "location":location,
        "types":types,
        "key":key,
    }
    r = requests.get(POI_url,params=params)
    results = r.json()
    return results